<template>
  <div class="doctor-dashboard">
    <h2>个人中心</h2>
    
    <!-- 数据概览卡片 -->
    <el-row :gutter="20" class="overview-cards">
      <el-col :span="12">
        <el-card class="overview-card">
          <template #header>
            <div class="card-header">
              <span>预约管理</span>
              <el-button type="primary" link @click="router.push('/doctor/appointments')">
                查看全部
                <el-icon><ArrowRight /></el-icon>
              </el-button>
            </div>
          </template>
          <div class="appointment-stats">
            <div class="stat-item">
              <span class="stat-value highlight">{{ pendingAppointments }}</span>
              <span class="stat-label">待处理预约</span>
            </div>
            <div class="next-appointment" v-if="nextAppointment">
              <h4>下次咨询</h4>
              <p>{{ nextAppointment.date }} {{ nextAppointment.time }}</p>
              <p>{{ nextAppointment.userName }}</p>
            </div>
          </div>
        </el-card>
      </el-col>

      <el-col :span="12">
        <el-card class="overview-card">
          <template #header>
            <div class="card-header">
              <span>咨询统计</span>
              <el-button type="primary" link @click="router.push('/doctor/history')">
                查看历史
                <el-icon><ArrowRight /></el-icon>
              </el-button>
            </div>
          </template>
          <div class="consulting-stats">
            <div class="stat-row">
              <div class="stat-item">
                <span class="stat-value">{{ totalConsultings }}</span>
                <span class="stat-label">总咨询次数</span>
              </div>
              <div class="stat-item">
                <span class="stat-value">{{ monthlyConsultings }}</span>
                <span class="stat-label">本月咨询</span>
              </div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { ArrowRight } from '@element-plus/icons-vue'

const router = useRouter()

// 待处理预约数量
const pendingAppointments = ref(3)

// 下次咨询信息
const nextAppointment = ref({
  date: '2024-03-20',
  time: '14:30',
  userName: '��三'
})

// 咨询统计
const totalConsultings = ref(156)
const monthlyConsultings = ref(12)
</script>

<style scoped>
.doctor-dashboard {
  padding: 20px;
}

h2 {
  margin: 0 0 30px;
  font-size: 24px;
  color: #2c3e50;
}

.overview-cards {
  margin-bottom: 30px;
}

.overview-card {
  height: 100%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.appointment-stats {
  padding: 20px 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  color: #409EFF;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #909399;
}

.next-appointment {
  border-top: 1px solid #EBEEF5;
  padding-top: 20px;
}

.next-appointment h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #2c3e50;
}

.next-appointment p {
  margin: 8px 0;
  color: #606266;
}

.consulting-stats {
  padding: 20px 0;
}

.stat-row {
  display: flex;
  justify-content: space-around;
}
</style> 